<?php

namespace vico\reservarBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * services 
 *
 * @ORM\Table(name="services")
 * @ORM\Entity
 */
class Service
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=120)
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="string", length=255)
     */
    private $description;

    /**
     * @var string
     *
     * @ORM\Column(name="code", type="string", length=20)
     */
    private $code;

				/**
					* @ORM\OneToMany(targetEntity="Product",mappedBy="service")
					*/

				private $products;

				public function __construct(){
						$this->code = "undefined";			
						$this->products = new \Doctrine\Common\Collections\ArrayCollection();
				}
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Service
     */
    public function setName($name)
    {
        $this->name = $name;
    
        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set description
     *
     * @param string $description
     * @return Service
     */
    public function setDescription($description)
    {
        $this->description = $description;
    
        return $this;
    }

    /**
     * Get description
     *
     * @return string 
     */
    public function getDescription()
    {
        return $this->description;
    }

    public function setProducts(\Doctrine\Common\Collections\ArrayCollection $product)
    {
        $this->products = $product;
    
        return $this;
    }
				public function getProducts(){

								return $this->products;	

				}

    /**
     * Set code
     *
     * @param string $code
     * @return Service
     */
    public function setCode($code)
    {
        $this->code = $code;
    
        return $this;
    }

    /**
     * Get code
     *
     * @return string 
     */
    public function getCode()
    {
        return $this->code;
    }
				public function __toString(){
								return $this->name;	
				}
}
